package mdt.ext;

import org.tigris.gef.base.ModeCreateFigPoly;
import org.tigris.gef.presentation.Fig;
import org.tigris.gef.presentation.FigPoly;

import java.awt.event.MouseEvent;

/**
 * Created by xiaobyu on 7/19/2016.
 */
public class ModeCreateFigPolyExt extends ModeCreateFigPoly {

    public Fig createNewItem(MouseEvent me, int snapX, int snapY) {
        FigPoly p = new FigPolyExt(snapX, snapY);
        p.addPoint(snapX, snapY); // add the first point twice
        _startX = _lastX = snapX;
        _startY = _lastY = snapY;
        _npoints = 2;
        return p;
    }
}
